package com.siashan.toolkit.lock4j;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * lock4j配置
 *
 * @author siashan
 * @since v1.0.1
 */
@Getter
@Setter
@Configuration
@ConfigurationProperties(prefix = Lock4jProperties.PREFIX)
public class Lock4jProperties {

    public static final String PREFIX = "siashan.lock4j";

    /**
     * 过期时间 单位：毫秒
     */
    private Long expireTimeout = 30000L;

    /**
     * 获取锁超时时间 单位：毫秒
     */
    private Long acquireTimeout = 3000L;

    /**
     * 获取锁失败时重试时间间隔 单位：毫秒
     */
    private Long retryInterval = 100L;

    /**
     * 锁前缀
     */
    private String keyPrefix = "lock4j::";

}
